<template>
  <div v-if="headerMenuName != '主页'">
    <aside :class="['aui-sidebar', `aui-sidebar--${$store.state.sidebarLayoutSkin}`]">
      <div class="aui-sidebar__inner">
        <el-menu
          :default-active="$store.state.sidebarMenuActiveName"
          :collapse="$store.state.sidebarFold"
          :unique-opened="true"
          :collapseTransition="false"
          class="aui-sidebar__menu"
        >
          <sub-menu
            v-for="menu in $store.state.sidebarMenuList"
            :key="menu.id"
            :menu="menu"
          />
        </el-menu>
      </div>
    </aside>
  </div>
</template>

<script>
/* eslint-disable */
import SubMenu from "./main-sidebar-sub-menu";
export default {
  data() {
    return {
      headerMenuName: ''
    };
  },
  components: {
    SubMenu,
  },
  created() {
    this.$store.state.activeHeaderMenu =
      window.SITE_CONFIG["headerMenuList"][0].id;
    this.$store.state.sidebarMenuList = window.SITE_CONFIG["menuList"];
  },
  methods: {
    setheaderMenuName (name) {
      this.headerMenuName = name
    }
  }
};
</script>
